/*
 * @Description: 
 * @version: 
 * @Author: CHEN
 * @Date: 2020-12-09 16:16:41
 * @LastEditors: CHEN
 * @LastEditTime: 2020-12-09 16:26:22
 */
window.onload=()=>{
    let run = true
    let chance_str = (n) => {
        if (n < 10) {
            n = '0' + n
        }
        return n
    };
    let time = () => {
        if (run) {
            var day = new Date()
            var h = day.getHours()
            // 对两位数补零
            h = chance_str(h)

            var m = day.getMinutes()
            // 对两位数补零
            m = chance_str(m)

            var s = day.getSeconds()
            // 对两位数补零
            s = chance_str(s)

            document.getElementById('time').innerHTML ='当前时间:' +  h + ':' + m + ':' + s
            // 一秒刷新一次时间
            setTimeout(time, 1000)
        }
    };

    time()

    let outBtn = document.getElementById("out")
    outBtn.addEventListener("click",()=>{
        window.location.href
           = "/SelectCourseSystem/outServlet"


    })

    
}